import { reactive, UnwrapNestedRefs } from 'vue';

export type OutputType<O extends object, T extends object> = O & {
  bindProps: UnwrapNestedRefs<T>;
};

export function hookResult<H extends object, P extends object>(
  handler: H,
  bindProps: P
): OutputType<H, P> {
  // @ts-ignore
  handler.bindProps = reactive(bindProps);

  return handler as OutputType<H, P>;
}

export const IS_MODAL = Symbol('IS_MODAL');
